<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page isELIgnored="false"%>
<%@ include file="../common/taglibs.jsp"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="renderer" content="webkit">
<title>D0开关控制</title>
<link rel="icon" href="favicon.ico" type="image/x-icon"/>
<!-- 当前页面样式 -->
<link rel="stylesheet" href="<s:url value="/css/common.css"/>"/>
<!-- 当前页面样式 END -->
<style type="text/css">
.blue{
	color: blue
}
</style>
<script type="text/javascript"
	src="<c:url value="/js/jquery-1.3.2.js" />"></script>
<script type="text/javascript">
$(document).ready(function(){
		$('#sub').click(function(){
			$("#queryForm").attr("action","<%=basePath%>/switchs/switchMcht.ct");
			$("#queryForm").submit();
			$(this).attr("disabled","true");
		});
		$('#master').click(function(){
			$("#queryForm").attr("action","<%=basePath%>/switchs/masterSwitchinit.ct");
			$("#queryForm").submit();
		});
		$('#masterMcht').click(function(){
			$("#queryForm").attr("action","<%=basePath%>/switchs/addSwitchinit.ct");
			$("#queryForm").submit();
		});
	});	
	function switchChange(orgCode,mchtCd,transCd)
	{		
		$("#queryForm").attr("action","<%=basePath%>/switchs/changeSwitchInit.ct?bean.insCd="+orgCode+"&bean.mchtCd="+mchtCd+"&bean.transCd="+transCd);
		$("#queryForm").submit();
	}
</script>
</head>

<body>
		<s:form id="queryForm" action="/switchs/switchMcht.ct" method="post"
			theme="simple">
			<table class="tb">
				<tbody>
				<tr class="tb-line">
            		<td class="tb-td" colspan="6"><div class="tb-h2">POS收单运营管理平台</div></td>
        		</tr>
				 <tr class="tb-line">
					<td class="tb-td" colspan="6">
						<div class="tb-h3">交易时间控制(针对商户)</div>
					</td>
				</tr>

				 <tr class="tb-line">
				 	<td width="12%" style="min-width: 150px" align="right" class="tb-td">
				 	 <div class="tb-h4" id="blackNum">商户号</div>
				 	 </td>
					<td class="tb-td">
                		<label class="tb-input-normal">
						<s:textfield  name="searchCondition.mchtId" cssClass="queryWidth" />
							</label>
							</td>
					<td width="12%" style="min-width: 150px" align="right" class="tb-td">
                <div class="tb-h4">交易名称：</div>
            		</td>
				<td class="tb-td">
                <label class="tb-select">
				 <s:select name="searchCondition.transCd" list="#{'1171':'T+0 实时收款','1011':'消费'}" headerKey="" headerValue="不限" cssClass="queryWidth" id="changeType"/> 
                </label>
                </td>
                	<td width="12%" style="min-width: 150px" align="right" class="tb-td">
                <div class="tb-h4">所属机构：</div>
            		</td>
				<td class="tb-td">
                <label class="tb-select">
				 <s:select cssClass="queryWidth" name="searchCondition.orgCode" id="orgCode"
							list="#request.orgList" listKey="insIdCd" listValue="insName" /> 
                </label>
                </td>										
				</tr>
				<tr>
						<td colspan="6" align="center"><span style="color: red"><s:actionerror /></span>
							<span style="color: red;"><s:actionmessage /></span > <span style="color: red;"><s:fielderror
									cssClass="fieldError" /></span>
							<span id="otherError"></span>
						</td>
					</tr>
				 <tr class="tb-line">
           		 <td class="tb-td line-submit" align="right" colspan="6">
                <label class="tb-input-submit"><input type="button" value="查询" id="sub"/></label>
				<label class="tb-input-submit"><s:reset value="取 消" /></label> 
 				<label class="tb-input-submit"><input type="button" value="添加控制商户" id="masterMcht"/></label>
				<label class="tb-input-submit"><input type="button" value="D0交易总控制(针对交易)" id="master"/></label>
				</td>
				</tr>
				
				<s:if
					test="#request.searchRsList != null && #request.searchRsList.size>0">
					<tr class="tb-line">
						<td class="tb-td paging" colspan="6"><page:pageCount
								max_pages="11" totalPage="${requestScope.totalPage}"
								currentPage="${requestScope.currentPage}"
								action="${rootPath}/switchs/switchMcht.ct?currentPage=" />

						</td>
					</tr>
				</s:if>
			</table>
			
				
	<div class="big-tb">
    <table class="tb" style="width: 100%;">
				<thead>
            	<tr class="tb-line">
                <th class="tb-th" colspan="6"><div class="tb-h3">交易时间控制列表(针对商户)</div></th>
            	</tr>
					 <tr class="tb-line bg-gray">
						<th class="tb-th" id="title">商户号</th>
						<th class="tb-th">交易名称</th>	
						<th class="tb-th">交易开始时间</th>		
						<th class="tb-th">交易结束时间</th>
						<th class="tb-th">状态</th>
						<th class="tb-th">操作</th>
					</tr>
				</thead>
				<tbody>
					<s:iterator value="#request.searchRsList" status="stat" id="bean">
							<tr class="tb-line" >
							<td class="tb-td"><s:property value="#bean.mchtCd"/></td>
							<td class="tb-td">
							<s:if test="#bean.transCd == \"1171\" ">
							T+0 实时收款 
							</s:if>
							<s:elseif test="#bean.transCd == \"1011\" ">
							消费
							</s:elseif>
							</td>
							<td class="tb-td"><s:property value="#bean.begin"/></td>
							<td class="tb-td"><s:property value="#bean.end"/></td>
							<td class="tb-td">
							<s:if test="#bean.flag==1">开启</s:if>
							<s:elseif test="#bean.flag==0">关闭</s:elseif>
							</td>
							<td align="center">
							<a href="javascript:void(0)" onclick="switchChange('<s:property value="#bean.insCd"/>','<s:property value="#bean.mchtCd"/>','<s:property value="#bean.transCd"/>')" class="blue">修改</a>
							</td>
						</s:iterator>
				</tbody>
			</table>
			</div>
		</s:form>
	<s:if test="#request.info_request !=null">
	<script language="javascript">
	    alert("${request.info_request}");
	    </script>
	</s:if>	
</body>
</html>
